<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    
    <head>
        <meta charset="utf-8">
        <title>
            X-admin v1.0
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="/lssm/Public/admin/css/x-admin.css" media="all">
    </head>
    
    <body>
        <div class="x-body">
            <table class="layui-table">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>授课时间</th>
                        <th>课时</th>
                        <th>老师总结</th>
                        <th>家长评论</th>
                        <th>家长签到</th>
                    </tr>
                </thead>
                <tbody>
                <?php foreach ($signs as $v) { ?>
                    <tr>
                        <td>
                            <?php echo ($v["id"]); ?>
                        </td>
                        <td style="font-size: 8px;">
                            <?php echo date('Y-m-d H:i',$v['addtime']) ?>
                        </td>
                        <td>
                            <?php echo ($v["keshi"]); ?>
                        </td>
                        <td style="padding: 1px 1px;">
                           <textarea cols="15" rows="3" placeholder="未评论" disabled=""><?php echo ($v["zongjie"]); ?></textarea>
                        </td>
                        <td style="padding: 1px 1px;">
                            <textarea class='comm' cols="15" rows="3" placeholder="请家长输入对本次授课评论"><?php echo ($v["comment"]); ?></textarea>
                        </td>
                        <td style="font-size: 8px;">
                        <?php if ($v['jz_qd'] == 1) { ?>
                            <span class="layui-btn" style="background: #FF6000;">已签到</span>
                        <?php }else { ?>
                            <span  class="layui-btn" onclick="ls_tongz(this,'<?php echo ($v["id"]); ?>')">签到</span>
                        <?php } ?>
                        </td>
                    </tr>
                <?php } ?>
                </tbody>
            </table>

        </div>
        <script src="/lssm/Public/admin/lib/layui/layui.js" charset="utf-8"></script>
        <script src="/lssm/Public/admin/js/x-layui.js" charset="utf-8"></script>
        <script>
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form()
              ,layer = layui.layer;
        
            });

            /*评论通知*/
            function ls_tongz(obj,id){
                layer.confirm('确认要提交吗？',function(index){
                    //发异步删除数据
                    var comm = $(obj).parents('tr').find('.comm').val();//获取评论
                    $.ajax({
                        url: "<?php echo U('jiazhang/qiandaosl');?>",//请求地址
                        type: "post",//请求方式
                        dataType: "json",//返回数据类型
                        data: {id:id,comm:comm},//发送的参数
                        })
                        .done(function(response) {
                              if(response.error==1){
                                layer.msg(response.info ,{icon:6});
                                location.reload();
                              }else{
                                layer.msg(response.info ,{icon:5});
                              }
                          })
                        .fail(function() {
                            alert("ajxs交互失败");
                        })  
                    return false;
                });
            }

        </script>
    </body>

</html>